function auth() {
    var user = getSession('user');
    if (!user) {
        return window.location.replace('./signin.html');
    } else {
        return user;
    }
}

function getSession(name) {
    var session = window.sessionStorage.getItem(name);
    if (!session) {
        return false;
    } else {
        return JSON.parse(session);
    }
}